--使用方法：直接粘贴到模组环境 "abc"改成角色标签 p为设置驯化度百分比100%

local p = 1

local UseableTargetedItem = require "components/useabletargeteditem"

local _StartUsingItem = UseableTargetedItem.StartUsingItem
function UseableTargetedItem:StartUsingItem(target, doer, ...)
    local usesuccess, usefailreason = _StartUsingItem(self, target, doer, ...)

    if usesuccess and doer and doer:HasTag("abc") then
        if target and target.components.domesticatable and target.components.domesticatable.domestication < p then
            local old = target.components.domesticatable.domestication
            target.components.domesticatable.domestication = p
            target:PushEvent("domesticationdelta", { old = old, new = p })
        end
    end

    return usesuccess, usefailreason
end